]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Remove padding from date strings
authorCarmen Bianca Bakker <carmen@carmenbianca.eu>
Mon, 15 Oct 2018 14:50:02 +0000 (16:50 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 25 Oct 2018 11:05:47 +0000 (13:05 +0200)
The padding is removed by using %-d instead of %e or %d.

Examples:

"%B %d %Y"  -> "October 04 2018"

"%B %e %Y"  -> "October  4 2018"

"%B %-d %Y" -> "October 4 2018"

https://gitlab.gnome.org/GNOME/gnome-shell/issues/666

js/misc/util.js
js/ui/calendar.js
js/ui/dateMenu.js

index 38b67e891fa29bf89d8ddf14c1a7d72a827e57f3..4e1f5de55db3eecea1186538b265e250b9eb3a29 100644 (file)
@@ -243,13 +243,13 @@ function formatTime(time, params) {
              followed by a time string in 24h format.
              i.e. "May 25, 14:30" */
             // xgettext:no-c-format
-            format = N_("%B %d, %H\u2236%M");
+            format = N_("%B %-d, %H\u2236%M");
         else
             /* Translators: this is the month name, day number, year
              number followed by a time string in 24h format.
              i.e. "May 25 2012, 14:30" */
             // xgettext:no-c-format
-            format = N_("%B %d %Y, %H\u2236%M");
+            format = N_("%B %-d %Y, %H\u2236%M");
     } else {
         // Show only the time if date is on today
         if (daysAgo < 1 || params.timeOnly)
@@ -272,13 +272,13 @@ function formatTime(time, params) {
              followed by a time string in 12h format.
              i.e. "May 25, 2:30 pm" */
             // xgettext:no-c-format
-            format = N_("%B %d, %l\u2236%M %p");
+            format = N_("%B %-d, %l\u2236%M %p");
         else
             /* Translators: this is the month name, day number, year
              number followed by a time string in 12h format.
              i.e. "May 25 2012, 2:30 pm"*/
             // xgettext:no-c-format
-            format = N_("%B %d %Y, %l\u2236%M %p");
+            format = N_("%B %-d %Y, %l\u2236%M %p");
     }
 
     let formattedTime = date.format(Shell.util_translate_time_string(format));
index 815c9f9c93b8e9e201e388ca14bc907e09b5fca9..241a91db43527cfd52ffc50c190a40c58819db74 100644 (file)
@@ -866,11 +866,11 @@ var EventsSection = new Lang.Class({
         if (sameYear(this._date, now))
             /* Translators: Shown on calendar heading when selected day occurs on current year */
             dayFormat = Shell.util_translate_time_string(NC_("calendar heading",
-                                                             "%A, %B %d"));
+                                                             "%A, %B %-d"));
         else
             /* Translators: Shown on calendar heading when selected day occurs on different year */
             dayFormat = Shell.util_translate_time_string(NC_("calendar heading",
-                                                             "%A, %B %d, %Y"));
+                                                             "%A, %B %-d, %Y"));
         this._title.label = this._date.toLocaleFormat(dayFormat);
     },
 
index 0497d6eeebe15acffd6907f416c493ea007c9405..83967c9f4a33b324907114bf73401aa72b01f36c 100644 (file)
@@ -73,7 +73,7 @@ var TodayButton = new Lang.Class({
          * "Tue 9:29 AM").  The string itself should become a full date, e.g.,
          * "February 17 2015".
          */
-        let dateFormat = Shell.util_translate_time_string (N_("%B %e %Y"));
+        let dateFormat = Shell.util_translate_time_string (N_("%B %-d %Y"));
         this._dateLabel.set_text(date.toLocaleFormat(dateFormat));
 
         /* Translators: This is the accessible name of the date button shown